import 'package:demo/app/widgets/line_horizontal.dart';
import 'package:demo/theme/app_colors.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../../../../theme/app_text_theme.dart';
import 'tab2_controller.dart';
import 'package:flutter/material.dart';

import 'package:get/get.dart';


class Tab2View extends GetView<Tab2Controller> {
  const Tab2View({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          margin: EdgeInsets.symmetric(horizontal: 15.w),
          padding: EdgeInsets.symmetric(horizontal: 15.w),
          decoration: BoxDecoration(
              color: Color_white,
              borderRadius: BorderRadius.all(Radius.circular(8.w))
          ),
          child: Column(
            children: [
              /// 单位名称
              SizedBox(
                height: 40.w,
                child: Row(children: [
                  Text('单位名称' ,style: text_131732_14),
                  SizedBox(width: 6.w),
                  Expanded(
                    child: KeyboardListener(
                      focusNode: controller.focusNode,
                      child: TextField(
                        controller: controller.companyNameController,
                        textAlign: TextAlign.right,
                        style: text_131732_14,
                        decoration: InputDecoration(
                          prefixText: "  ",
                          isDense: true,
                          contentPadding: EdgeInsets.symmetric(vertical: 9.w),
                          counterText: "", // 去掉底部计数
                          enabledBorder:  const UnderlineInputBorder(borderSide: BorderSide.none), //无焦点时状态
                          focusedBorder:  const UnderlineInputBorder(borderSide: BorderSide.none), //有焦点时状态
                          hintText: '请输入单位名称',
                          hintStyle: text_grey_14,
                        ),
                      ),
                    ),
                  ),
                ]),
              ),
              const LineHorizontal(),
              /// 单位所在城市
              InkWell(
                onTap: () => controller.chooseProvince(),
                child: SizedBox(
                  height: 40.w,
                  child: Row(children: [
                    Text('单位所在城市' ,style: text_131732_14),
                    SizedBox(width: 6.w),
                    Expanded(child: Obx(()=>Text(controller.selectArea.value.value,style: text_131732_14,maxLines: 1, overflow: TextOverflow.ellipsis,textAlign:TextAlign.right))),
                    Image.asset('assets/images/ic_next.png',width: 15.w,height: 15.w),
                  ]),
                ),
              ),
              const LineHorizontal(),
              /// 单位详细地址
              SizedBox(
                height: 40.w,
                child: Row(children: [
                  Text('单位详细地址' ,style: text_131732_14),
                  SizedBox(width: 6.w),
                  Expanded(
                    child: KeyboardListener(
                      focusNode: controller.focusNode,
                      child: TextField(
                        controller: controller.companyAddressController,
                        textAlign: TextAlign.right,
                        style: text_131732_14,
                        decoration: InputDecoration(
                          prefixText: "  ",
                          isDense: true,
                          contentPadding: EdgeInsets.symmetric(vertical: 9.w),
                          counterText: "", // 去掉底部计数
                          enabledBorder:  const UnderlineInputBorder(borderSide: BorderSide.none), //无焦点时状态
                          focusedBorder:  const UnderlineInputBorder(borderSide: BorderSide.none), //有焦点时状态
                          hintText: '请输入单位详细地址',
                          hintStyle: text_grey_14,
                        ),
                      ),
                    ),
                  ),
                ]),
              ),
              const LineHorizontal(),
              /// 单位电话
              SizedBox(
                height: 40.w,
                child: Row(children: [
                  Text('单位电话' ,style: text_131732_14),
                  SizedBox(width: 6.w),
                  Expanded(
                    child: KeyboardListener(
                      focusNode: controller.focusNode,
                      child: TextField(
                        controller: controller.companyPhoneController,
                        textAlign: TextAlign.right,
                        style: text_131732_14,
                        decoration: InputDecoration(
                          prefixText: "  ",
                          isDense: true,
                          contentPadding: EdgeInsets.symmetric(vertical: 9.w),
                          counterText: "", // 去掉底部计数
                          enabledBorder:  const UnderlineInputBorder(borderSide: BorderSide.none), //无焦点时状态
                          focusedBorder:  const UnderlineInputBorder(borderSide: BorderSide.none), //有焦点时状态
                          hintText: '请输入单位电话',
                          hintStyle: text_grey_14,
                        ),
                      ),
                    ),
                  ),
                ]),
              ),
              const LineHorizontal(),
              /// 单位性质
              InkWell(
                onTap: () => controller.chooseNature(),
                child: SizedBox(
                  height: 40.w,
                  child: Row(children: [
                    Text('单位性质' ,style: text_131732_14),
                    SizedBox(width: 6.w),
                    Expanded(child: Obx(()=>Text(controller.selectNature.value.value,style: text_131732_14,maxLines: 1, overflow: TextOverflow.ellipsis,textAlign:TextAlign.right))),
                    Image.asset('assets/images/ic_next.png',width: 15.w,height: 15.w),
                  ]),
                ),
              ),
              const LineHorizontal(),
              /// 所属行业
              InkWell(
                onTap: () => controller.chooseIndustry(),
                child: SizedBox(
                  height: 40.w,
                  child: Row(children: [
                    Text('所属行业' ,style: text_131732_14),
                    SizedBox(width: 6.w),
                    Expanded(child: Obx(()=>Text(controller.selectIndustry.value.value,style: text_131732_14,maxLines: 1, overflow: TextOverflow.ellipsis,textAlign:TextAlign.right))),
                    Image.asset('assets/images/ic_next.png',width: 15.w,height: 15.w),
                  ]),
                ),
              ),
              const LineHorizontal(),
              /// 职业
              InkWell(
                onTap: () => controller.chooseProfession(),
                child: SizedBox(
                  height: 40.w,
                  child: Row(children: [
                    Text('职业' ,style: text_131732_14),
                    SizedBox(width: 6.w),
                    Expanded(child: Obx(()=>Text(controller.selectProfession.value.value,style: text_131732_14,maxLines: 1, overflow: TextOverflow.ellipsis,textAlign:TextAlign.right))),
                    Image.asset('assets/images/ic_next.png',width: 15.w,height: 15.w),
                  ]),
                ),
              ),
              const LineHorizontal(),
              /// 收入类型
              InkWell(
                onTap: () => controller.chooseEarn(),
                child: SizedBox(
                  height: 40.w,
                  child: Row(children: [
                    Text('收入类型' ,style: text_131732_14),
                    SizedBox(width: 6.w),
                    Expanded(child: Obx(()=>Text(controller.selectEarn.value.value,style: text_131732_14,maxLines: 1, overflow: TextOverflow.ellipsis,textAlign:TextAlign.right))),
                    Image.asset('assets/images/ic_next.png',width: 15.w,height: 15.w),
                  ]),
                ),
              ),
              const LineHorizontal(),
              /// 月收入
              InkWell(
                onTap: () => controller.chooseAmount(),
                child: SizedBox(
                  height: 40.w,
                  child: Row(children: [
                    Text('月收入' ,style: text_131732_14),
                    SizedBox(width: 6.w),
                    Expanded(child: Obx(()=>Text(controller.selectAmount.value.value,style: text_131732_14,maxLines: 1, overflow: TextOverflow.ellipsis,textAlign:TextAlign.right))),
                    Image.asset('assets/images/ic_next.png',width: 15.w,height: 15.w),
                  ]),
                ),
              ),
            ],
          ),
        ),
        SizedBox(height: 30.w),
        Row(
          mainAxisAlignment : MainAxisAlignment.center,
          children: [
            RawMaterialButton(
              elevation:0,
              highlightElevation:0,
              child: Text('上一步',style: text_main_16b),
              onPressed: ()=> controller.back(),
            ),
            SizedBox(width: 15.w),
            RawMaterialButton(
              fillColor: Color_main,
              elevation:0,
              highlightElevation:0,
              shape : RoundedRectangleBorder(borderRadius : BorderRadius.all(Radius.circular(22.w))),
              constraints: BoxConstraints.tightFor(width: Get.width - 60.w - 80.w, height:44.w),
              child: Text('下一步',style: text_white_16b),
              onPressed: ()=> controller.submit(),
            ),
        ]),
        SizedBox(height: 30.w),
      ],
    );
  }
}
